//
//  File.swift
//  
//
//  Created by 钟志远 on 2021/4/17.
//

import Foundation
import Vapor
import Fluent

final class UserInfo: Model, Content {
    static var schema: String = "user_info"
    
    init() { }

    @ID(key: .id)
    var id: UUID?
    
    @Field(key: "nick_name")
    var nickName: String
    
    @Timestamp(key: "created_at", on: .create)
    var createdAt: Date?
    
    @Timestamp(key: "updated_at", on: .update)
    var updatedAt: Date?
    
    @Parent(key: "user_id")
    var user: User

    init(nickName: String) {
        self.nickName = nickName
    }
}
